<template>
  <div class="app-container">
    <!-- 查询条件区域-->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
      <el-form-item label="任务名称" prop="task_name">
        <el-input   style="width: 145px;"
          v-model="queryParams.task_name"
          placeholder="请输入任务名称"
          clearable
          @keyup.enter.native="handleQuery"
          size="small"
        />
      </el-form-item>
      <el-form-item label="机器人名称" prop="robot_name">
        <el-input  style="width: 150px;"
          v-model="queryParams.robot_name"
          placeholder="请输入机器人名称"
          clearable
          @keyup.enter.native="handleQuery"
          size="small"
        />
      </el-form-item>
      <el-form-item label="创建时间">
        <el-date-picker
            v-model="queryParams.create_times"
            style="width: 215px" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
     <!--增删改查按钮区域-->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['nssc:patroltask:add']"
        >新增</el-button>
      </el-col>
     <el-col :span="1.5">
       <el-button
            type="success"
            plain
            icon="el-icon-folder-checked"
            size="mini"
            :disabled="multiple"
            @click="handleAuto"
            v-hasPermi="['nssc:patroltask:add']"
        >设置自动</el-button>
      </el-col>
      <el-col :span="1.5">
      <el-button
          type="success"
         plain
          icon="el-icon-folder-delete"
         size="mini"
          :disabled="multiple"
          @click="handleUAuto"
          v-hasPermi="['nssc:patroltask:add']"
      >取消自动</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['robot:patroltask:remove']"
        >删除</el-button>
      </el-col>
<!--      <el-col :span="1.5">
        <el-button
            type="danger"
            plain
            icon="el-icon-s-operation"
            size="mini"
            :disabled="multiple"
            @click="handleRestore"
            v-hasPermi="['robot:patroltask:edit']"
        >恢复任务</el-button>
      </el-col>-->
     <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
     <!-- 数据列表区域-->
    <el-table v-loading="loading" :data="patroltaskList" @selection-change="handleSelectionChange" :cell-style="{borderColor:'rgb(1 5 43)'}" :header-cell-style="{borderColor: 'rgb(1 5 43)'}" >
      <el-table-column type="selection" width="55" align="center" />
    <!--  <el-table-column label="序号" type="index" align="center" prop="id" width="100" />-->
      <el-table-column label="自动任务" align="center" prop="is_auto" >
         <template slot-scope="scope">
           <el-tag  v-if="scope.row.is_auto==1">是</el-tag>
           <el-tag  v-else>否</el-tag>
         </template>
       </el-table-column>
<!--      <el-table-column
        label="任务编码"
        align="center"
        prop="task_num"
        :show-overflow-tooltip="true"
      />-->
      <el-table-column label="任务名称" align="center" prop="task_name" />
      <el-table-column label="机器人名称" align="center" prop="robot_name"/>
      <el-table-column label="执行时刻(H)" align="center" prop="execution_time">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.execution_time!=''&&scope.row.execution_time!=null">{{scope.row.execution_time}}H</el-tag>
          <span style="color: #1952e3" v-else>--------</span>
        </template>
      </el-table-column>
      <!--<el-table-column label="停留时间(s)" align="center" prop="residence_time" width="110" />-->
<!--      <el-table-column label="停留时间(s)" align="center" prop="residence_time">
        <template slot-scope="scope">
          <span>≈{{scope.row.residence_time*10}}s</span>
        </template>
      </el-table-column>-->
      <el-table-column label="速度(m/min)" align="center" prop="speed">
        <template slot-scope="scope">
          <span>{{scope.row.speed}}m/min</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="task_type">
        <template slot-scope="scope">
<!--          <el-tag v-if="scope.row.task_state==0">未下发</el-tag>-->
          <el-tag v-if="scope.row.task_state==1">待执行</el-tag>
          <el-tag v-else-if="scope.row.task_state==0">已销毁</el-tag>
          <el-tag v-else>已执行</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="creater_time" width="170">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.creater_time) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="330">
        <template slot-scope="scope">
         <el-button
              size="mini"
              type="text"
              icon="el-icon-circle-check"
              @click="handleRestore(scope.row)"
              v-hasPermi="['nssc:patrolpoint:edit']"
          >恢复任务</el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-circle-close"
              @click="handleCancel(scope.row)"
              v-hasPermi="['nssc:patrolpoint:edit']"
          >销毁任务</el-button>
          <el-button  v-if="scope.row.task_type==1"
            size="mini"
            type="text"
            icon="el-icon-tickets"
            @click="handleTaskPoint(scope.row)"
            v-hasPermi="['nssc:patrolpoint:query']"
          >任务详情</el-button>
          <el-button  size="mini"
                      type="text"
                      icon="el-icon-tickets"
                      @click="handleTaskReport(scope.row)"
                      v-hasPermi="['nssc:patrolpoint:query']"
          >报告</el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['nssc:patrolpoint:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!--列表分页区域-->
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList" style="background:rgb(1 5 43);"
    />
    <!-- 添加或修改对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="630px" @close="handleCancle" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="12">
          </el-col>
          <el-col :span="12">
            <el-form-item label="机器人" prop="robot_config_id">
              <el-select v-model="form.robot_config_id" clearable  placeholder="请选机器人" @change="getPoints">
                <el-option
                  v-for="item in robotList"
                  :key="item.id"
                  :label="item.robot_name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="任务名称" prop="task_name">
              <el-input v-model="form.task_name" placeholder="请输入任务名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="巡检速度" prop="speed">
              <el-select v-model="form.speed" placeholder="请选择机器人速度">
                <el-option
                    v-for="sp in speeds"
                    :key="sp"
                    :label="sp"
                    :value="sp"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="执行时刻" prop="execution_time" id="zxsk" style="display: block">
              <el-select v-model="form.execution_time" placeholder="请选择执行时刻(小时)" @change="getOptionszxsj" >
                <el-option
                    v-for="sj in zxsk"
                    :key="sj"
                    :label="sj"
                    :value="sj"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
<!--          <el-col :span="12">
            <el-form-item prop="residence_time">
                <span slot="label">
                <span style="color: red">* </span><span>停留时间</span>
              </span>
              <el-input id="residencetime" v-model="form.residence_time" placeholder="请输入停留时间1x10(秒)" maxlength="1" show-word-limit  clearable/>
            </el-form-item>
          </el-col>-->
          <el-col :span="24">
            <el-form-item label="巡检说明">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容(0-255)"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
           <el-form-item label="巡检点设置" style="width: 50%;" />
          <!--  巡检点设置数据列表区域-->
          <el-table class="tabled" ref="mutipleTable" :data="patrolpointList"  id="xjdsz" style="display: block" @selection-change="handleSelectionChangePatrolPoint">
            <el-table-column type="selection" width="55" align="center" />
          <!--  <el-table-column label="序号" type="index" align="center" prop="id" width="100" />-->
            <el-table-column label="巡检内容" prop="point_type" width="130">
              <template slot-scope="scope">
                <el-select v-model="scope.row.point_type" multiple placeholder="请选择">
                  <el-option
                      v-for="item in point_types"
                      :key="item.key"
                      :label="item.point_type_name"
                      :value="item.point_type"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="池子编号" prop="pond_num" width="140">
              <template slot-scope="scope">
              <el-select v-model="scope.row.pond_num" placeholder="选池子编号">
                <el-option
                    v-for="item in pool_nums"
                    :key="item.key"
                    :label="item.pond_name"
                    :value="item.pond_num"
                ></el-option>
              </el-select>
              </template>
            </el-table-column>
            <el-table-column label="标签号" align="center" prop="label_num"  with="200">
              <template slot-scope="scope">
                <span>{{scope.row.label_num}}</span>
              </template>
            </el-table-column>
            <el-table-column label="巡检点标题" align="center" prop="position_num" :show-overflow-tooltip="true" width="100"/>
<!--            <el-table-column label="距离起点距离(m)" align="center" prop="position_dist" with="200"/>-->
          </el-table>
         </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" id="patrolid">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!--点位详情对话框 -->
    <el-dialog :title="titlepoint" :visible.sync="open1" width="800px">
        <span style="color: #3b8ace;font-size: 12px">&nbsp;巡检点=池子编号+标签号</span>
        <el-row>
          <!-- 巡检点设置数据列表区域-->
          <el-table ref="mutipleTable" :data="patroltaskpointList" :cell-style="{borderColor:'rgb(1 5 43)'}" :header-cell-style="{borderColor: 'rgb(1 5 43)'}">
            <!-- <el-table-column label="序号" type="index" align="center" prop="id" width="100" />-->
            <el-table-column label="池子编号" align="center" prop="pond_num">
              <template slot-scope="scope">
                <span v-if="scope.row.pond_num=='1'">R滤格</span>
                <span v-if="scope.row.pond_num=='2'">S滤格</span>
                <span v-if="scope.row.pond_num=='3'">T滤格</span>
                <span v-if="scope.row.pond_num=='4'">U滤格</span>
                <span v-if="scope.row.pond_num=='5'">V滤格</span>
                <span v-if="scope.row.pond_num=='6'">W滤格</span>
                <span v-if="scope.row.pond_num=='7'">X滤格</span>
                <span v-if="scope.row.pond_num=='8'">Y滤格</span>
              </template>
            </el-table-column>
            <el-table-column label="标签号" align="center" prop="label_num"/>
            <el-table-column label="巡检内容" align="center" prop="point_type" width="120">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.point_type.includes('1')">漂浮物</el-tag>
                <el-tag v-if="scope.row.point_type.includes('2')">青苔</el-tag>
                <el-tag v-if="scope.row.point_type.includes('3')">安全帽</el-tag>
                <el-tag v-if="scope.row.point_type.includes('4')">阀门状态</el-tag>
                <el-tag v-if="scope.row.point_type.includes('5')">曝气</el-tag>
                <el-tag v-if="scope.row.point_type.includes('6')">砂面</el-tag>
              </template>
            </el-table-column>
            <el-table-column label="巡检点标题" align="center" prop="position_num" :show-overflow-tooltip="true"/>
            <el-table-column label="距离起点距离(m)" align="center" prop="position_dist" width="200" />
          </el-table>
        </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel1">取 消</el-button>
      </div>
    </el-dialog>
    <!--报告对话框 -->
    <el-dialog :title="titlepoint2" :visible.sync="open2" width="1000px"  @close="cancel2">
        <el-row>
          <!-- 巡检点设置数据列表区域-->
          <el-table v-loading="loading2" :data="partroltaskhis" @selection-change="handleSelectionChange"
                    :cell-style="{ borderColor: 'rgb(1 5 43)' }" :header-cell-style="{ borderColor: 'rgb(1 5 43)' }">
            <el-table-column label="机器人名称" align="center" prop="robot_name" />
            <el-table-column label="任务名称" align="center" prop="task_name" />
            <el-table-column label="执行时刻(H)" align="center" prop="execution_time">
              <template slot-scope="scope">
                <span>{{ scope.row.execution_time }}H</span>
              </template>
            </el-table-column>
            <el-table-column label="生成时间" align="center" prop="creater_time">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.creater_time) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button size="mini" type="text" icon="el-icon-document" @click="handlereport(scope.row)"
                      >查看报告</el-button>
                <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                      >删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel2">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 报告详情-->
    <el-dialog :title="title3" :visible.sync="open3" @close="cancel4" width="1130px">
      <el-row :gutter="20" v-loading="loading3" type="flex" justify="center" align="middle">
        <el-col :span="28" :xs="24">
          <div style="text-align: left;padding-bottom: 2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>报告参数</span><el-button v-print size="mini" style="float: right">打印</el-button>
          </div>
          <div id="app">
            <el-col :span="howWidth" style="padding-left:0;padding-right:0;">
              <div class="box">
                <div class="content1">任务名称</div>
                <div class="content2" style="color: #75bfff">{{form4.task_name}}</div>
              </div>
            </el-col>
            <el-col :span="howWidth" style="padding-left:0;padding-right:0;">
              <div class="box">
                <div class="content1">机器人名称</div>
                <div class="content2"  style="color: #75bfff">{{form4.robot_name}}</div>
              </div>
            </el-col>
            <el-col :span="howWidth" style="padding-left:0;padding-right:0;">
              <div class="box">
                <div class="content1">巡检点数</div>
                <div class="content2"  style="color: #75bfff">{{form4.xjdsl}}（个）</div>
              </div>
            </el-col>
            <el-col :span="howWidth" style="padding-left:0;padding-right:0;">
              <div class="box">
                <div class="content1">执行时刻</div>
                <div class="content2"  style="color: #75bfff">{{form4.execution_time}}（H）</div>
              </div>
            </el-col>
          </div>
          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>巡检采集</span>
            <!--  数据列表区域-->
            <el-table class="tabled1" v-loading="loading7" :data="taskresultList" @selection-change="handleSelectionChange"
                      :cell-style="{ borderColor: 'rgb(1 5 43)' }" :header-cell-style="{ borderColor: 'rgb(1 5 43)' }">
              <el-table-column label="池子编号" align="center" prop="pool_num">
                <template slot-scope="scope">
                  <span v-if="scope.row.pool_num=='1'">R滤格</span>
                  <span v-if="scope.row.pool_num=='2'">S滤格</span>
                  <span v-if="scope.row.pool_num=='3'">T滤格</span>
                  <span v-if="scope.row.pool_num=='4'">U滤格</span>
                  <span v-if="scope.row.pool_num=='5'">V滤格</span>
                  <span v-if="scope.row.pool_num=='6'">W滤格</span>
                  <span v-if="scope.row.pool_num=='7'">X滤格</span>
                  <span v-if="scope.row.pool_num=='8'">Y滤格</span>
                </template>
              </el-table-column>
              <el-table-column label="标签号" align="center" prop="label_num">
                <template slot-scope="scope">
                  <span>{{ scope.row.label_num }}标签</span>
                </template>
              </el-table-column>
              <el-table-column label="液位值" align="center" prop="yw" />
              <el-table-column label="采集时间" align="center" prop="creater_time" >
                <template slot-scope="scope">
                  <span>{{ parseTime(scope.row.creater_time) }}</span>
                </template>
              </el-table-column>
              <el-table-column label="采集视频" align="center" class-name="small-padding fixed-width"  width="200px">
                <template slot-scope="scope">
                  <el-button size="mini" type="text" icon="el-icon-view"  v-if="scope.row.video_url!=null && typeof scope.row.video_url.split(';')[0]!='undefined'"  @click="handleViewVD2(scope.row.video_url.split(';')[0])">视频1</el-button>
                  <el-button size="mini" type="text" icon="el-icon-view"  v-if="scope.row.video_url!=null && typeof scope.row.video_url.split(';')[1]!='undefined'"  @click="handleViewVD2(scope.row.video_url.split(';')[1])">视频2</el-button>
                  <span style="font-size: 12px" v-if="typeof scope.row.video_url=='undefined'||scope.row.video_url==null||scope.row.video_url==''">-------</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>液位趋势</span>
            <el-dropdown  @command="lgxzf" style="margin-left:5px;">
              <el-button type="primary" size="min" style="width: 100px;
                height: 32px;
                border: 1px solid #1890ff;
                border-radius: 6px;
                font-size: 12px;
                color: #C1C1C1;">
                {{ lgxz }}<i class="el-icon-arrow-down el-icon--right"></i>
              </el-button>
              <el-dropdown-menu slot="dropdown" style="background-color: #122a64;border-color: #1890ff;">
                <el-dropdown-item style="color: #5DCBFF;" command="全部" >全部</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="R滤格">R滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="S滤格">S滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="T滤格">T滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="U滤格">U滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="V滤格">V滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="W滤格">W滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="X滤格">X滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="Y滤格">Y滤格</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
            <div id="container3" ref="chinaMapChart3" style="height:350px;"></div>
          </div>
          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>算法分析</span>
            <!--  数据列表区域-->
            <el-table class="tabled1" v-loading="loading6" :data="areationresultList1" @selection-change="handleSelectionChange"
                      :cell-style="{ borderColor: 'rgb(1 5 43)' }" :header-cell-style="{ borderColor: 'rgb(1 5 43)' }">
              <el-table-column label="池子编号" align="center" prop="pond_num">
                <template slot-scope="scope">
                  <span v-if="scope.row.pond_num=='1'">R滤格</span>
                  <span v-if="scope.row.pond_num=='2'">S滤格</span>
                  <span v-if="scope.row.pond_num=='3'">T滤格</span>
                  <span v-if="scope.row.pond_num=='4'">U滤格</span>
                  <span v-if="scope.row.pond_num=='5'">V滤格</span>
                  <span v-if="scope.row.pond_num=='6'">W滤格</span>
                  <span v-if="scope.row.pond_num=='7'">X滤格</span>
                  <span v-if="scope.row.pond_num=='8'">Y滤格</span>
                </template>
              </el-table-column>
              <el-table-column label="标签号" align="center" prop="point">
                <template slot-scope="scope">
                  <span>{{ scope.row.point }}标签</span>
                </template>
              </el-table-column>
              <el-table-column label="报警状态" align="center" prop="state_name">
                <template slot-scope="scope">
                  <el-tag style="color: #04913c!important" v-if="scope.row.state_name=='正常'">正常</el-tag>
                  <el-tag style="color: #b0360b!important" v-else>报警</el-tag>
                </template>
              </el-table-column>
<!--              <el-table-column label="缺陷个数" align="center" prop="defect" />-->
              <el-table-column label="阀门状态" align="center" prop="fmzt" />
              <el-table-column label="标尺读值" align="center" prop="ruler_value">
                <template slot-scope="scope">
                  <span v-if=" typeof scope.row.ruler_value=='undefined' || scope.row.ruler_value==null || scope.row.ruler_value==''">-------</span>
                  <span v-else >{{scope.row.ruler_value}}</span>
                </template>
              </el-table-column>
<!--              <el-table-column label="视频帧数" align="center" prop="frame" />
              <el-table-column label="关键帧数" align="center" prop="key_frame" />-->
              <el-table-column label="分析内容" align="center" prop="state">
                <template slot-scope="scope">
                  <el-tag  v-if="scope.row.state.includes('0')">无分析内容</el-tag>
                  <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('1')">阀门丢失</el-tag>
                  <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('2')">板结</el-tag>
                  <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('3')">青苔</el-tag>
                  <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('4')">未佩戴安全帽</el-tag>
                  <span v-if="scope.row.state ==''||scope.row.state ==null">-------</span>
                </template>
              </el-table-column>
              <el-table-column label="分析时间" align="center" prop="creater_time" width="220px">
                <template slot-scope="scope">
                  <span>{{ parseTime(scope.row.creater_time) }}</span>
                </template>
              </el-table-column>
              <el-table-column label="结果视频" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                  <el-button size="mini" type="text" icon="el-icon-view" v-if="scope.row.sample_video!=null && typeof scope.row.sample_video.split(';')[0]!='undefined'" @click="handleViewVD1(scope.row.sample_video.split(';')[0])">结果视频1</el-button>
                  <el-button size="mini" type="text" icon="el-icon-view" v-if="scope.row.sample_video!=null && typeof scope.row.sample_video.split(';')[1]!='undefined'" @click="handleViewVD1(scope.row.sample_video.split(';')[1])">结果视频2</el-button>
                  <el-button size="mini" type="text" icon="el-icon-view" v-if="scope.row.sample_video!=null && typeof scope.row.sample_video.split(';')[2]!='undefined'" @click="handleViewVD1(scope.row.sample_video.split(';')[2])">结果视频3</el-button>
                  <span style="font-size: 12px" v-if="typeof scope.row.sample_video=='undefined'||scope.row.sample_video==null||scope.row.sample_video==''">-------</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
<!--          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>运行总图</span>
            <div id="container6" ref="chinaMapChart6" style="height:420px;"></div>
          </div>-->
          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <span>报警统计-缺陷个数</span>
            <el-dropdown  @command="bjtj" style="margin-left:5px;">
              <el-button type="primary" size="min" style="width: 100px;
                height: 32px;
                border: 1px solid #1890ff;
                border-radius: 6px;
                font-size: 12px;
                color: #C1C1C1;">
                {{ gjs }}<i class="el-icon-arrow-down el-icon--right"></i>
              </el-button>
              <el-dropdown-menu slot="dropdown" style="background-color: #122a64;border-color: #1890ff;">
                <el-dropdown-item style="color: #5DCBFF;" command="全部" >全部</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="R滤格">R滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="S滤格">S滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="T滤格">T滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="U滤格">U滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="V滤格">V滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="W滤格">W滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="X滤格">X滤格</el-dropdown-item>
                <el-dropdown-item style="color: #5DCBFF;" command="Y滤格">Y滤格</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
          <div style="text-align: left;padding-bottom:2%;font-size:14px;color:#5DCBFF;padding-left: 1%;">
            <div id="container" ref="chinaMapChart2" style="height:320px;width: 48%;float: left"></div>
            <div id="container3" ref="chinaMapChart4" style="height:320px;width: 48%;float: left"></div>
          </div>
        </el-col>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel4">关 闭</el-button>
      </div>
    </el-dialog>
    <!-- 单个分析结果-->
    <el-dialog :title="title5" :visible.sync="open5" width="920px">
      <!--  数据列表区域-->
      <el-table v-loading="loading5" :data="areationresultList" @selection-change="handleSelectionChange"
                :cell-style="{ borderColor: 'rgb(1 5 43)' }" :header-cell-style="{ borderColor: 'rgb(1 5 43)' }">
        <el-table-column label="池子编号" align="center" prop="pond_num">
          <template slot-scope="scope">
            <span v-if="scope.row.pond_num=='1'">R滤格</span>
            <span v-if="scope.row.pond_num=='2'">S滤格</span>
            <span v-if="scope.row.pond_num=='3'">T滤格</span>
            <span v-if="scope.row.pond_num=='4'">U滤格</span>
            <span v-if="scope.row.pond_num=='5'">V滤格</span>
            <span v-if="scope.row.pond_num=='6'">W滤格</span>
            <span v-if="scope.row.pond_num=='7'">X滤格</span>
            <span v-if="scope.row.pond_num=='8'">Y滤格</span>
          </template>
        </el-table-column>
        <el-table-column label="巡检点" align="center" prop="point">
          <template slot-scope="scope">
            <span>{{ scope.row.point }}</span>
          </template>
        </el-table-column>
        <el-table-column label="报警状态" align="center" prop="state_name">
          <template slot-scope="scope">
            <el-tag style="color: #04913c!important" v-if="scope.row.state_name=='正常'">正常</el-tag>
            <el-tag style="color: #b0360b!important" v-else>报警</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="阀门状态" align="center" prop="fmzt" />
        <el-table-column label="标尺读值" align="center" prop="ruler_value" />
        <el-table-column label="分析内容" align="center" prop="state">
          <template slot-scope="scope">
            <el-tag  v-if="scope.row.state.includes('0')">无报警内容</el-tag>
            <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('1')">阀门丢失</el-tag>
            <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('2')">板结</el-tag>
            <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('3')">青苔</el-tag>
            <el-tag style="color: #b0360b!important" v-if="scope.row.state.includes('4')">未佩戴安全帽</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="分析时间" align="center" prop="creater_time" width="220px">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.creater_time) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="分析结果" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <!-- <el-button size="mini" type="text" icon="el-icon-view" @click="picView(scope.row)">图片列表</el-button>-->
            <el-button size="mini" type="text" icon="el-icon-view" v-if="scope.row.sample_video!=null && scope.row.sample_video!=''" @click="handleViewVD1(scope.row)">结果视频</el-button>
            <span style="font-size: 12px"v-else>-------</span>
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="open5 = false">关 闭</el-button>
      </div>
    </el-dialog>
    <!-- 视频回放对话框-->
    <el-dialog :title="title8" :visible.sync="open8" width="900px">
      <videoPlayer class="vjs-custom-skin videoPlayer" ref="videoplayer" :playsinline="true" width="750px" height="250px"
                   :options="playerOptions" customEventName="changed">
      </videoPlayer>
      <div slot="footer" class="dialog-footer">
        <el-button @click="open8 = false">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  addPatrolTask,
  AutoPatrolTask, cancelTask,
  delPatrolTask,
  getPatrolTask,
  getPatrolTaskPoint,
  getPatrolTaskPoints, getReportInfo,
  listPatrolTask,
  listPatrolTasks,
  restoreTask,
  UAutoPatrolTask
} from "@/api/nssc/patroltask/patroltask";
import {listRobotConfig} from "@/api/nssc/robotconfig/robotconfig";
import {listPointsByRobotId} from "@/api/nssc/patrolpoint/patrolpoint";
import $ from "jquery";
import "@/assets/styles/robt-bg.css";
import {
  aerationResultReport, getResultVideo, gettaskResultVideo, getUploadVideo,
  listAerationPort1,
  taskResultReport
} from "@/api/nssc/aerationresult/aerationresult";
import * as echarts from "echarts";
import {videoPlayer} from "vue-video-player";
import 'video.js/dist/video-js.css';
import 'vue-video-player/src/custom-theme.css';
import 'videojs-contrib-hls';
import point from "@/assets/imgs/point1.png";
import rbt from "@/assets/images/rbt1.png";
import {getMapParamInfo, getTrackMap1robot} from "@/api/nssc/trackmap/trackmap";
import Vue from "vue";
import print from 'vue-print-nb';
Vue.use(print);
let myChart3 = null;
let myChart4 = null;
let myChart2 = null;
export default {
  components: {
    videoPlayer,
  },
  data() {
    return {
      execution_time:null, //日期选择
      pickerOption: {
        disabledDate: time => {
          const dateVal = new Date(this.execution_time).getTime();
          if (dateVal) {
            return time.getTime() > dateVal + 1;
          }
        }
      },
      printBill: {
        id: "printBill",
        popTitle: this.title, // 打印配置页上方标题
        extraHead: "", //最上方的头部文字，附加在head标签上的额外标签,使用逗号分隔
        preview: "", // 是否启动预览模式，默认是false（开启预览模式，可以先预览后打印）
        previewTitle: "", // 打印预览的标题（开启预览模式后出现）,
        previewPrintBtnLabel: "", // 打印预览的标题的下方按钮文本，点击可进入打印（开启预览模式后出现）
        zIndex: "", // 预览的窗口的z-index，默认是 20002（此值要高一些，这涉及到预览模式是否显示在最上面）
        clickMounted() { },
        previewBeforeOpenCallback() { }, //预览窗口打开之前的callback（开启预览模式调用）
        previewOpenCallback() { }, // 预览窗口打开之后的callback（开启预览模式调用）
        beforeOpenCallback() {
          console.log("打印前");
        }, // 开启打印前的回调事件
        openCallback() { }, // 调用打印之后的回调事件
        closeCallback() { }, //关闭打印的回调事件（无法确定点击的是确认还是取消）
      },
      playerOptions: {
        width: "750px",
        height: "250px",
        language: "zh-CN",
        playbackRates: [0.7, 1.0, 1.5, 2.0],// 播放速度  美团附近药店买点药涂抹下
        muted: false,// 默认情况下将会消除任何音频
        autoplay: false,// 如果true,浏览器准备好时开始回放。
        controls: true, //不显示暂停、声音、进度条组件
        loop: false, // 视频一结束就重新开始。
        fluid: true, // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
        notSupportedMessage: "此视频暂无法播放，请稍后再试", // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
        sources: [
          {
            type: "video/mp4",
            src: "", // url地址
          },
        ],
        controlBar: {
          timeDivider: false, // 当前时间和持续时间的分隔符
          durationDisplay: true, // 显示持续时间
          remainingTimeDisplay: true, // 是否显示剩余时间功能
          fullscreenToggle: true, // 是否显示全屏按钮
        }
      },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      howWidth: 12,
      bglx: "普通任务",
      task_names:[],
      // 选中巡检点数组
      point_ids: [],
      pond_nums:[],
      label_nums:[],
      position_dists:[],
      xypositions:[],
      position_nums:[],
      points_types:[],
      areationresultList1: [],
      areationresultList: [],
      taskresultList: [],
      points_type:[],
      partroltaskhis: [],
      timer:null,//定时器
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      //任务列表
      typeList: [],
      //机器人列表
      robotList:[],
      //巡检任务表格数据
      patroltaskList: [],
      //巡检点表格数据
      patrolpointList: [],
      zxsk:['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23'],
      speeds:['1000','2000','3000'],
      pool_nums:[
          {pond_num:1,pond_name:'R滤格'},{pond_num:2,pond_name:'S滤格'},{pond_num:3,pond_name:'T滤格'},{pond_num:4,pond_name:'U滤格'},
          {pond_num:5,pond_name:'V滤格'},{pond_num:6,pond_name:'W滤格'},{pond_num:7,pond_name:'X滤格'},{pond_num:8,pond_name:'Y滤格'}
      ],
      point_types:[
          {point_type:"1",point_type_name:'漂浮物'},{point_type:"2",point_type_name:'青苔'},
          {point_type:"3",point_type_name:'安全帽'},{point_type:"4",point_type_name:'阀门状态'},
          {point_type:"5",point_type_name:'曝气'},{point_type:"6",point_type_name:'砂面'}
      ],
      checkList: [],
      //巡检任务巡检点表格数据
      patroltaskpointList:[],
      // 弹出层标题
      title: "",
      title2: "",
      title3: "",
      title5: "",
      titlepoint: "",
      titlepoint2:"",
      // 是否显示弹出层
      loading6:true,
      open: false,
      open8: false,
      // 是否显示弹出层
      open1: false,
      open2: false,
      open3: false,
      open5:false,
      title8:"",
      loading1:true,
      loading2:true,
      loading3:true,
      loading7:true,
      loading5:true,
      videotape_time: undefined,
      lgxz: "全部",
      gjs: "全部",
      czbq:[],
      yw:[],
      czbq1:[],
      yw1:[],
      czbq2:[],
      yw2:[],
      czbq3:[],
      yw3:[],
      czbq4:[],
      yw4:[],
      czbq5:[],
      yw5:[],
      czbq6:[],
      yw6:[],
      czbq7:[],
      yw7:[],
      czbq8:[],
      yw8:[],
      zcztj:0,
      zcztj1:0,
      zcztj2:0,
      zcztj3:0,
      zcztj4:0,
      zcztj5:0,
      zcztj6:0,
      zcztj7:0,
      zcztj8:0,
      gjztj:0,
      gjztj1:0,
      gjztj2:0,
      gjztj3:0,
      gjztj4:0,
      gjztj5:0,
      gjztj6:0,
      gjztj7:0,
      gjztj8:0,
      form4:{},//报告参数
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 8,
        task_name: undefined,
        task_num: undefined,
        robot_name: undefined,
        task_type: undefined,
        execution_time:undefined,
        residence_time:undefined,
        create_times: [],
      },
      queryParams1: {
        task_name: undefined,
        task_num: undefined,
        robot_name: undefined,
        task_type: undefined,
        execution_time:undefined,
        residence_time:undefined,
        create_times: [],
      },
      queryParams2: {
      },
      queryParams3: {
      },
      // 表单参数
      form: {},
      rules: {
        task_name: [
          { required: true, message: "任务名称不能为空", trigger: "blur" }
        ] ,
        robot_config_id: [
          { required: true, message: "机器人名称不能为空"}
        ],
      /*  task_type: [
          { required: true, message: "任务类型不能为空", trigger: "blur" }
        ],*/
       /* residence_time: [
          { required: true, message: "停留时间不能为空", trigger: "blur" }
        ],*/
    /*    inspect_type: [
          { required: true, message: "巡检视频类型不能为空"}
        ],*/
        speed: [
          { required: true, message: "机器人速度不能为空"}
        ],
        pool_num: [
          { required: true, message: "池子编号不能为空"}
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  mounted() {
    this.timer = setInterval(()=>{
      this.getList(); //刷新列表
    },9000);//9秒
  },
  beforeDestroy() {
    //清除定时器
    if(this.timer) {
      clearInterval(this.timer); //关闭
    }
  },
  methods: {
    handleViewVD1(sample_video) {
      let mediaUrl = sample_video;
      this.getMedia1(mediaUrl);
    },//巡检采集视频
    //获取结果视频，并播放视频
    getMedia1(mediaUrl) {
      getResultVideo(mediaUrl).then(response => {
        if(typeof response.data !="undefined"){
          let videopath = response.data.videopath;
          if(videopath!="") {
            this.open8 = true;
            this.title8 = "查看分析结果视频";
            this.playerOptions.sources[0].src = videopath;
          }else {
            this.$modal.msg("未查到结果视频！");
          }
        }else {
          this.$modal.msg("未查到结果视频！");
        }
      });
    },
    cancel4() {
      this.open3 = false;
      this.queryParams2.id= undefined;
      this.queryParams2.task_his_id=undefined;
      this.queryParams2.robot_name= undefined;
      this.queryParams2.task_name= undefined;
      this.queryParams2.task_id= undefined;
      this.queryParams2.robot_config_id= undefined;
      this.lgxz="全部";
      this.gjs="全部";
      this.form4 = {};
      this.queryParams3 = {};
      if(myChart3 != null){myChart3.clear();myChart3 = null;}
      if(myChart2 != null){myChart2.clear();myChart2 = null;}
      if(myChart4 != null){myChart4.clear();myChart4 = null;}
    },//获取原视频，并播放视频
    handleViewVD2(video_url) {
      gettaskResultVideo(video_url).then(response => {
        if(typeof response.data !="undefined"){
          let videopath = response.data.videopath;
          if(videopath!="") {
            this.open8 = true;
            this.title8 = "查看巡检采集视频";
            this.playerOptions.sources[0].src = videopath;
          }else {
            this.$modal.msg("未查到巡检采集视频！");
          }
        }else {
          this.$modal.msg("未查到巡检采集视频！");
        }
      });
    },
    //报告详情
    handlereport(row) {
      this.loading3 = true;
      this.open3 = true;
      this.title3 = "报告详情";
      this.xjcj(row.id);//巡检采集 ----row.id历史记录id
      this.fxjg(row);//分析结果
      this.queryParams3.id = row.id;
      getReportInfo(this.queryParams3).then(response => {
        this.form4 = response.data.bgcs//报告参数
      });
      //this.getMap(row.robot_config_id);//曝气总图
      this.loading3 = false;
    }, //液位选择框
    lgxzf(lgxz) {
      this.lgxz = lgxz;
      if(lgxz=="全部") {
        this.ywEchart(this.czbq,this.yw);
      } else if(lgxz=="R滤格"){
        this.ywEchart(this.czbq1,this.yw1);
      } else if(lgxz=="S滤格"){
        this.ywEchart(this.czbq2,this.yw2);
      } else if(lgxz=="T滤格"){
        this.ywEchart(this.czbq3,this.yw3);
      } else if(lgxz=="U滤格"){
        this.ywEchart(this.czbq4,this.yw4);
      } else if(lgxz=="V滤格"){
        this.ywEchart(this.czbq5,this.yw5);
      } else if(lgxz=="W滤格"){
        this.ywEchart(this.czbq6,this.yw6);
      } else if(lgxz=="X滤格"){
        this.ywEchart(this.czbq7,this.yw7);
      } else if(lgxz=="Y滤格"){
        this.ywEchart(this.czbq8,this.yw8);
      } else{
        this.ywEchart(this.czbq,this.yw);
      }
    },
    //告警选择框
    bjtj(gjs) {
      this.gjs = gjs;
      if(gjs=="全部") {
        this.spfxtj(this.zcztj, this.gjztj);//算法告警统计
        this.spqxsl(this.rqsj.length==0?[0]:this.rqsj, this.qxsl.length==0?[0]:this.qxsl);//缺陷数量
      } else if(gjs=="R滤格"){
        this.spfxtj(this.zcztj1, this.gjztj1);//算法告警统计
        this.spqxsl(this.rqsj1.length==0?[0]:this.rqsj1, this.qxsl1.length==0?[0]:this.qxsl1);//缺陷数量
      } else if(gjs=="S滤格"){
        this.spfxtj(this.zcztj2, this.gjztj2);//算法告警统计
        this.spqxsl(this.rqsj2.length==0?[0]:this.rqsj2, this.qxsl2.length==0?[0]:this.qxsl2);//缺陷数量
      } else if(gjs=="T滤格"){
        this.spfxtj(this.zcztj3, this.gjztj3);//算法告警统计
        this.spqxsl(this.rqsj3.length==0?[0]:this.rqsj3, this.qxsl3.length==0?[0]:this.qxsl3);//缺陷数量
      } else if(gjs=="U滤格"){
        this.spfxtj(this.zcztj4, this.gjztj4);//算法告警统计
        this.spqxsl(this.rqsj4.length==0?[0]:this.rqsj4, this.qxsl4.length==0?[0]:this.qxsl4);//缺陷数量
      } else if(gjs=="V滤格"){
        this.spfxtj(this.zcztj5, this.gjztj5);//算法告警统计
        this.spqxsl(this.rqsj5.length==0?[0]:this.rqsj5, this.qxsl5.length==0?[0]:this.qxsl5);//缺陷数量
      } else if(gjs=="W滤格"){
        this.spfxtj(this.zcztj6, this.gjztj6);//算法告警统计
        this.spqxsl(this.rqsj6.length==0?[0]:this.rqsj6, this.qxsl6.length==0?[0]:this.qxsl6);//缺陷数量
      } else if(gjs=="X滤格"){
        this.spfxtj(this.zcztj7, this.gjztj7);//算法告警统计
        this.spqxsl(this.rqsj7.length==0?[0]:this.rqsj7, this.qxsl7.length==0?[0]:this.qxsl7);//缺陷数量
      } else if(gjs=="Y滤格"){
        this.spfxtj(this.zcztj8, this.gjztj8);//算法告警统计
        this.spqxsl(this.rqsj8.length==0?[0]:this.rqsj8, this.qxsl8.length==0?[0]:this.qxsl8);//缺陷数量
      } else{
        this.spfxtj(this.zcztj, this.gjztj);//算法告警统计
        this.spqxsl(this.rqsj.length==0?[0]:this.rqsj, this.qxsl.length==0?[0]:this.qxsl);//缺陷数量
      }
    },//巡检采集
    xjcj(id){
      this.loading7 = true;
      this.queryParams2.task_his_id = id; //根据历史任务id
      taskResultReport(this.queryParams2).then(response => {
        this.taskresultList = response.rows;
        this.loading7 = false;
        this.czbq =[];//池子、标签号
        this.yw = [];//液位
        this.czbq1 =[];//池子、标签号
        this.yw1 = [];//液位
        this.czbq2 =[];//池子、标签号
        this.yw2 = [];//液位
        this.czbq3 =[];//池子、标签号
        this.yw3 = [];//液位
        this.czbq4 =[];//池子、标签号
        this.yw4 = [];//液位
        this.czbq5 =[];//池子、标签号
        this.yw5 = [];//液位
        this.czbq6 =[];//池子、标签号
        this.yw6 = [];//液位
        this.czbq7 =[];//池子、标签号
        this.yw7 = [];//液位
        this.czbq8 =[];//池子、标签号
        this.yw8 = [];//液位
        let size_yw = response.rows.length;
        for(let x=0;x<size_yw;x++){
          let czbh="";
          if(response.rows[x].pool_num==1) {
            this.czbq1.push("R滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw1.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==2) {
            this.czbq2.push("S滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw2.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==3) {
            this.czbq3.push("T滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw3.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==4) {
            this.czbq4.push("U滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw4.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==5) {
            this.czbq5.push("V滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw5.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==6) {
            this.czbq6.push("W滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw6.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==7) {
            this.czbq7.push("X滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw7.push(response.rows[x].yw);//液位
          }else if(response.rows[x].pool_num==8) {
            this.czbq8.push("Y滤格" +response.rows[x].label_num+"标签");//池子、标签号
            this.yw8.push(response.rows[x].yw);//液位
          }
          if(response.rows[x].pool_num==1) czbh ="R滤格";
          if(response.rows[x].pool_num==2) czbh ="S滤格";
          if(response.rows[x].pool_num==3) czbh ="T滤格";
          if(response.rows[x].pool_num==4) czbh ="U滤格";
          if(response.rows[x].pool_num==5) czbh ="V滤格";
          if(response.rows[x].pool_num==6) czbh ="W滤格";
          if(response.rows[x].pool_num==7) czbh ="X滤格";
          if(response.rows[x].pool_num==8) czbh ="Y滤格";
          this.czbq.push(czbh+response.rows[x].label_num+"标签");//池子、标签号
          this.yw.push(response.rows[x].yw);//液位
        }
        if(size_yw > 0){
          this.ywEchart(this.czbq,this.yw)
        }else{
          this.ywEchart([0],[0])
        };
        this.loading7 = false;
      });
    },
    //查询某个报告所有分析结果
    fxjg(row) {
      this.loading6 = true;
      //根据坐标查询巡检点、机器人id、任务id
      this.queryParams2.xyposition = null;
      this.queryParams2.task_id = row.id;
      aerationResultReport(this.queryParams2).then(response => {
        this.zcztj = 0;//正常总统计
        this.zcztj1 =0;
        this.zcztj2 =0;
        this.zcztj3 =0;
        this.zcztj4 = 0;
        this.zcztj5 =0;
        this.zcztj6 =0;
        this.zcztj7 =0;
        this.zcztj8 =0;
        this.gjztj = 0;//告警总统计
        this.gjztj1 =0;
        this.gjztj2 =0;
        this.gjztj3 =0;
        this.gjztj4 = 0;
        this.gjztj5 =0;
        this.gjztj6 =0;
        this.gjztj7 =0;
        this.gjztj8 =0;
        this.rqsj=[];//日期
        this.qxsl=[];//缺陷数量
        this.rqsj1=[];
        this.qxsl1=[];
        this.rqsj2=[];
        this.qxsl2=[];
        this.rqsj3=[];
        this.qxsl3=[];
        this.rqsj4=[];
        this.qxsl4=[];
        this.rqsj5=[];
        this.qxsl5=[];
        this.rqsj6=[];
        this.qxsl6=[];
        this.rqsj7=[];
        this.qxsl7=[];
        this.rqsj8=[];
        this.qxsl8=[];
        this.areationresultList1 = response.rows;
        this.loading6 = false;
        if(typeof response.rows!='undefined') {
          let size_sfnltj = response.rows.length;
          for(let x=0;x < size_sfnltj;x++) {
            let czbh="";
            if(response.rows[x].pond_num=='1') {
              if(response.rows[x].state_alerm=='0'){this.zcztj1=this.zcztj1 +1;}
              else{this.gjztj1=this.gjztj1 +1;}
              this.rqsj1.push("R滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl1.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='2') {
              if(response.rows[x].state_alerm=='0'){this.zcztj2=this.zcztj2 +1;}
              else{this.gjztj2=this.gjztj2 +1;}
              this.rqsj2.push("S滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl2.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='3') {
              if(response.rows[x].state_alerm=='0'){this.zcztj3=this.zcztj3 +1;}
              else{this.gjztj3=this.gjztj3 +1;}
              this.rqsj3.push("T滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl3.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='4') {
              if(response.rows[x].state_alerm=='0'){this.zcztj4=this.zcztj4 +1;}
              else{this.gjztj4=this.gjztj4 +1;}
              this.rqsj4.push("U滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl4.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='5') {
              if(response.rows[x].state_alerm=='0'){this.zcztj5=this.zcztj5 +1;}
              else{this.gjztj5=this.gjztj5 +1;}
              this.rqsj5.push("V滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl5.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='6') {
              if(response.rows[x].state_alerm=='0'){this.zcztj6=this.zcztj6 +1;}
              else{this.gjztj6=this.gjztj6 +1;}
              this.rqsj6.push("W滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl6.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='7') {
              if(response.rows[x].state_alerm=='0'){this.zcztj7=this.zcztj7 +1;}
              else{this.gjztj7=this.gjztj7 +1;}
              this.rqsj7.push("X滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl7.push(response.rows[x].defect);
            }else if(response.rows[x].pond_num=='8') {
              if(response.rows[x].state_alerm=='0'){this.zcztj8=this.zcztj8 +1;}
              else{this.gjztj8=this.gjztj8 +1;}
              this.rqsj8.push("Y滤格" +response.rows[x].point+"标签");//池子、标签号
              this.qxsl8.push(response.rows[x].defect);
            }
            if(response.rows[x].state_alerm=='0'){this.zcztj=this.zcztj +1;}
            else{this.gjztj=this.gjztj +1;}
            if(response.rows[x].pond_num==1) czbh ="R滤格";
            if(response.rows[x].pond_num==2) czbh ="S滤格";
            if(response.rows[x].pond_num==3) czbh ="T滤格";
            if(response.rows[x].pond_num==4) czbh ="U滤格";
            if(response.rows[x].pond_num==5) czbh ="V滤格";
            if(response.rows[x].pond_num==6) czbh ="W滤格";
            if(response.rows[x].pond_num==7) czbh ="X滤格";
            if(response.rows[x].pond_num==8) czbh ="Y滤格";
            this.rqsj.push(czbh+response.rows[x].point+"标签");//池子、标签号
            this.qxsl.push(response.rows[x].defect);
          }
          if(size_sfnltj > 0){
            this.spfxtj(this.zcztj, this.gjztj);//算法告警统计
            this.spqxsl(this.rqsj, this.qxsl);//缺陷数量
          }else{
            this.spfxtj(0, 0);//算法告警统计
            this.spqxsl([0],[0]);//缺陷数量
          }
        }else{
          this.spfxtj(0, 0);//算法告警统计
          this.spqxsl([0],[0]);//缺陷数量
        }
      });
    },//查询某个报告所有分析结果
    zdbg() {
      this.$router.push('/nssc/task/pttask');
    },
    txbg() {
      this.$router.push('/nssc/task/txtask');
    },
    bglxs(bglx) {
      this.bglx = bglx;
    },
    //自定义对话框关闭方法
    handleCancle () {
      $("#patrolid").css("display","");
      $("#xjdsz").css("display","");//巡检点列表
      $("#zxsk").css("display","");//执行时刻
      this.form.execution_time = undefined;
      this.queryParams.execution_time = undefined;
      this.$refs.form.resetFields()
      this.dialogVisible = false
    },
    //根据机器人id、执行时间查询是否有关联任务
    getOptionszxsj(execution_time) {
      this.queryParams.execution_time = execution_time;//设置站点id条件，查询工艺体
      listPatrolTasks(this.queryParams).then(response => {
        if(typeof(response)!="undefined" && response != null && response.rows.length>0) {
          $("#patrolid").css("display","none");
          this.$modal.confirm1('当前执行时间任务已创建！');
        }else {
          $("#patrolid").css("display","");
        }
      });
    },
    //根据机器人id，查询巡检点
    getPoints(id){
      this.queryParams.robot_config_id = id;//通过机器人id，查询巡检点
      listPointsByRobotId(id).then(response => {
        this.patrolpointList = response.rows;
        this.patrolpointList.forEach(item=> {
          item.pond_num = this.pool_nums[0].pond_num;
        })
      });
    },
    /** 查询机器人列表 */
    getrobotList() {
      listRobotConfig(this.queryParams).then(response => {
        this.robotList = response.rows;
      });
    },
    /** 查询巡检任务列表 */
    getList() {
      this.loading = true;
      listPatrolTask(this.queryParams).then(response => {
        this.patroltaskList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      $("#xjdsz").css("display","");//巡检点列表
      $("#zxsk").css("display","");//执行时刻
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        point_name: undefined,
        point_num:undefined,
        robot_name:undefined,
        task_id:undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams.create_times= [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.task_names = selection.map(item => item.task_name)
      this.single = selection.length!=1
      this.multiple = !selection.length
    },
    // 多选框选中点位数据
    handleSelectionChangePatrolPoint(selection) {
      this.point_ids = selection.map(item => item.id);
      this.pond_nums = selection.map(item => item.pond_num);
      this.label_nums = selection.map(item => item.label_num);
      this.position_dists = selection.map(item => item.position_dist);
      this.xypositions = selection.map(item => item.xyposition);
      this.position_nums = selection.map(item => item.position_num);
      this.points_type = selection.map(item => item.point_type);
      this.points_types = [];//清空
      for (let i = 0; i < this.points_type.length; i++) {
          this.points_types[i] = this.points_type[i].toString();
      }
    },//电子地图
    getMap(robotid) {
      this.open1 = true;
      this.title = "巡检电子轨道地图";
      this.queryParams.robotid = robotid;
      getTrackMap1robot(this.queryParams).then(response => {
        if (response.data != null && response.data.dzdt.length > 0) {
          this.result = response.data.dzdt;
          this.picpath = response.data.pic;//地图地址
          this.arrdata = [[]];//初始化地图值
          //机器人运行轨迹 //轨道地图数据
          //如果有当前巡检点位置坐标获取当前位置坐标
          if (typeof (response.data.positionxy) != "undefined") {
            let positionxy = response.data.positionxy.split(",");//xy坐标
            let xposition = positionxy[0];//机器人开始位置x坐标
            let yposition = positionxy[1];//机器人开始位置y坐标
            for (let i = 0; i < this.result.length; i++) {
              //因为我在后台取出来的数据是一行的，字符串形式
              let dataArray = this.result[i].xyposition.split(",");
              //这句话是必须的，每次都要新建一个一维数组,不然会报错
              this.arrdata[i] = new Array();
              for (let j = 0; j < dataArray.length; j++) {
                this.arrdata[i][j] = dataArray[j];
              }
            }
            const dtop = this.arrdata;
            //电子地图
            let track_map_id = response.data.track_map_id;
            //地图方向参数配置
            getMapParamInfo(track_map_id).then(response => {
              if (response != null && response.data != null) {
                //调用电子地图
                this.mapEchart(dtop, xposition, yposition, response.data.mleft, response.data.mright, response.data.mtop, response.data.mbottom);
              } else { //默认方向
                this.mapEchart(dtop, xposition, yposition, 0, 0, 0, 0);
              }
            });
          } else {
            this.mapEchart([], 0, 0, 0, 0, 0, 0);
          }
        }
      });
    },  /* 缺陷统计*/
    spqxsl(rqs, spzs){
      setTimeout(() => {
        myChart4 = echarts.init(this.$refs.chinaMapChart4)
        let option4;
        const labelOption = {
          show: true,
          position:'top',
          distance: 15,
          align:'left',
          verticalAlign: 'middle',
          color: '#00ccff',
          rotate: 90,
          fontsize:16,
         /* formatter: '{c}  {name|{a}}',*/
          formatter: '{c}',
          fontSize: 10,
          rich: {
            name: {}
          }
        };
        option4 = {
          title: {
            text: '缺陷个数',
            y:'top',
            x:'left',
            textStyle: {
              color: '#2b49a9'
            }
          },
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'shadow'
            }
          },
          color: ['#02678c'],
          legend: {
            data: ['缺陷个数'],
            textStyle: {
              color: "#9d9e9f"
            }
          },
          toolbox: {
            show: true,
            orient: 'vertical',
            left: 'right',
            top: 'center',
            feature: {
              mark: { show: true },
            }
          },
          xAxis: [
            {
              type: 'category',
              axisLine: {
                show: true, // 不显示坐标轴线
                lineStyle: {
                  color: '#00ccff', //x轴的颜色
                },
              },
              //横坐标值颜色
              axisLabel: {
                show: true,
                textStyle: {
                  color: '#7287ab'
                }
              },
              splitLine: {
                show: false // 不显示网格线
              },
              axisTick: { show: false },
              data:rqs
            }
          ],
          yAxis: [
            {
              type: 'value',
              axisTick: {
                show: true,  //刻度线
              },
              axisLabel: {
                show: true, //隐藏刻度值
              },
              axisLine: {
                show: true,//隐藏y轴
                lineStyle: {
                  color: '#00ccff', //x轴的颜色
                },
              } ,
              splitLine: {
                show: false // 不显示网格线
              },
            }
          ],
          series: [
            {
              barWidth: '16%',
              name: '缺陷个数',
              type: 'bar',
              label: labelOption,
              emphasis: {
                focus: 'series'
              },
              data:spzs,
              itemStyle: {
                color: '#0d69ab' // 设置曲线颜色为红色（十六进制）
              },
            }
          ], dataZoom: [
          {
            fillerColor:'#0e2e79',
            borderColor:'#1c44a2',
            height:20,
            //  bottom:10,
            type: 'inside',
            startValue: 0,
            endValue: 4
          },
          {
            fillerColor:'#0e2e79',
            borderColor:'#1c44a2',
            height:20,
            //  bottom:10,
            startValue: 0,
            endValue: 4
          }
        ]
        };
        if (option4 && typeof option4 === 'object') {
          myChart4.setOption(option4);
        }
        window.addEventListener("resize", () => {
          if(myChart4!=null)myChart4.resize();
        });//同比缩放
      }  , 1);
    }, //告警正常统计
    spfxtj(zcztj,gjztj) {
      setTimeout(() => {
        myChart2 = echarts.init(this.$refs.chinaMapChart2)
        let option2;
        option2 = {
          title: {
                 text: '报警统计',
                 y:'top',
                 x:'left',
                 textStyle: {
                   color: '#2b49a9'
                 }
               },
          tooltip: {
            trigger: 'item'
          },
          legend: {
            top: '5%',
            left: 'center',
            textStyle: {
              color: "#9d9e9f"
            }
          },
          series: [
            {
              color: ['#07ad68', '#cc410e'],
              name: '',
              type: 'pie',
              radius: ['50%', '70%'],
              center: ['50%', '60%'],
              // adjust the start and end angle
              startAngle: 180,
              endAngle: 360,
              data: [
                {value: zcztj, name: '正常统计'+'（'+zcztj+'）'},
                {value: gjztj, name: '报警统计'+'（'+gjztj+'）'},
              ]
            }
          ]
        };

        if (option2 && typeof option2=== 'object') {
          myChart2.setOption(option2);
        }
        window.addEventListener("resize", () => {
          if (myChart2 != null) myChart2.resize();
        });//同比缩放
      } , 1);
    },//液位曲线图
    ywEchart(czbq,yw){
      setTimeout(() => {
        myChart3 = echarts.init(this.$refs.chinaMapChart3)
        let option3;
        option3 = {
          xAxis: {
            type: 'category',
            axisLine: {
              show: true, // 不显示坐标轴线
              lineStyle: {
                color: '#00ccff', //x轴的颜色
              },
            },
            //横坐标值颜色
            axisLabel: {
              show: true,
              textStyle: {
                color: '#7287ab'
              }
            },
            splitLine: {
              show: false // 不显示网格线
            },
            data: czbq
          },
          yAxis: {
            type: 'value',
            axisTick: {
              show: true,  //刻度线
            },
            axisLabel: {
              show: true, //隐藏刻度值
            },
            axisLine: {
              show: true,//隐藏y轴
              lineStyle: {
                color: '#00ccff', //x轴的颜色
              },
            } ,
            splitLine: {
              show: false // 不显示网格线
            },
          },
          series: [
            {
              data: yw,
              itemStyle: {
                color: '#0fa160' // 设置曲线颜色为红色（十六进制）
              },
              type: 'line',
              smooth: true,
              markPoint: {
                data: [
                  { type: 'max', name: 'Max' },
                  { type: 'min', name: 'Min' }
                ]
              },
              markLine: {
                data: [{ type: 'average', name: 'Avg' }]
              }
            }
          ], dataZoom: [
            {
              fillerColor:'#0e2e79',
              borderColor:'#1c44a2',
              height:20,
              //  bottom:10,
              type: 'inside',
              startValue: 0,
              endValue: 6
            },
            {
              fillerColor:'#0e2e79',
              borderColor:'#1c44a2',
              height:20,
              //  bottom:10,
              startValue: 0,
              endValue: 6
            }
          ]
        };
        if (option3 && typeof option3 === 'object') {
          myChart3.setOption(option3);
        }
        window.addEventListener("resize", () => {
          if(myChart3!=null)myChart3.resize();
        });
      }, 1);
    }, /*电子轨道图*/
    mapEchart(dtop, xposition, yposition, mleft, mright, mtop, mbottom) {
      setTimeout(() => {
        myChart = echarts.init(this.$refs.chinaMapChart6)
        let option2;
        //轨道地图数据
        let img = document.createElement('img');
        img.src = (this.picpath == null || this.picpath == '') ? require('@/assets/images/map-default.png')
            : this.picpath;
        option2 = {
          tooltip: {
            trigger: 'item',
            formatter: (params) => {  // params就是数据，这里可以打印一下看看
              // return 出去什么，鼠标移入就显示什么,marker就是提示前面蓝色的圆点
              if (typeof params.data[0] == 'undefined') {
                return ``
              } else {
                /*  return `${params.data[2]}</br>${params.marker}横坐标:${params.data[0]}</br>纵坐标:${params.data[1]}`*/
                return `${params.data[2]}`
              }
            }
          },
          /* backgroundColor: {
             type: 'pattern',
             repeat: 'no-repeat',
             width:'1060',
             height:'420',
             image: img, // 轨道图底图
           },*/
          title: {
            /* text: '机器人巡检轨迹图',*/
            left: 'center'
          },
          grid: {//底图四个方向调整
            top: mtop + '%',
            bottom: mbottom + '%',
            left: mleft + '%',
            right: mright + '%'
          },
          xAxis: {
            splitLine: { //网格线
              show: false
            },
            type: 'value',
            axisLine: {
              onZero: false,
              show: false//隐藏y轴
            },
            axisTick: {
              show: false
            },
            axisLabel: {
              show: false, //隐藏刻度值
            }
          },
          yAxis: {
            splitLine: { //网格线
              show: false
            },
            type: 'value',
            axisLine: {
              onZero: false,
              show: false//隐藏y轴
            },
            axisTick: {
              show: false,  //刻度线
            },
            axisLabel: {
              show: false, //隐藏刻度值
            }
          },
          series: [
            {
              label: {
                show: true,
                position: "top",
                formatter: params => {
                  return `${params.data[2].includes("报警") ? '{b|' + params.data[2] + '}' : params.data[2].includes("正常") ?  '{c|' + params.data[2] + '}':'{d|' + params.data[2] + '}'}`
                },  // label不支持html片段
                // formatter: '{@value}'// 点旁边显示label，这里使用name: '横坐标'这样写也可以，鼠标移入出现提示。
                rich: { // 因为label不支持html片段，所以css样式需要使用rich给添加进去  // formatter: '{b|{b}}\n{cstyle|{c}}', 详见https://echarts.apache.org/zh/option.html#series-pie.label
                  b: {
                    fontSize: 12,
                    color: "#f5072b",
                  },
                  c: {
                    fontSize: 12,
                    color: '#36e19a'
                  },
                  d: {
                    fontSize: 12,
                    color: '#b6fc2f'
                  }
                }
              },
              id: 'a',
              /* type: (this.picpath == null || this.picpath == '') ? 'line':'scatter',//scatter 散点，line 曲线*/
              type: 'line',
              smooth: true,
              itemStyle: {
                // 设置线条颜色
                normal: {
                  color: (this.picpath == null || this.picpath == '') ? '#1446a2' : 'rgb(4,24,169)',
                  lineStyle: {
                    width: (this.picpath == null || this.picpath == '') ? 5 : 5,
                    type: (this.picpath == null || this.picpath == '') ? 'solid' : 'solid'//可选值还有 dotted  solid
                  }
                }
              },
              symbolSize: 14,//巡检点大小
              symbol: 'image://' + point,//巡检点图标
              data: dtop,
              //  symbol: 'circle',
              markPoint: {
                label: {
                  color: 'blue',  // 文字颜色
                  // padding: [0, 0,-10, 0], // 可用padding调整图片内文字距离
                  show: true,
                  //formatter: '巡检机器人'// 自定义文字内容
                },
                //机器人大小
                itemStyle: {
                  color: {
                    type: 'linear',
                    colorStops: [{
                      offset: 0, color: 'blue' // 0% 处的颜色
                    }, {
                      offset: 1, color: 'blue' // 100% 处的颜色
                    }]
                  }
                },
                //symbol: 'circle',
                symbol: 'image://' + rbt,
                // 自定义图片作为标注展示
                // symbolSize: [58, 38],  // 调整图片的长宽
                // symbolOffset: [10, '-50%'],  // 调整标注图片的位移方向 大小
                symbolSize: 16,//机器人大小
                data: [{//1机器人移动坐标位置
                  xAxis: xposition,
                  yAxis: yposition,
                } /*,{//2机器人移动坐标位置
                  xAxis:23000,
                  yAxis:21500,
                }*/],
              }
            },
            // 闪烁点的重点是以下配置
            {
              // 设置圆心点特效动画、大小
              type: 'effectScatter',
              data: dtop,
              symbolSize: 6,
              coordinateSystem: 'cartesian2d',
              // 何时显示特效:'render'-绘制完成后显示特效 'emphasis'-高亮（hover）的时候显示特效
              showEffectOn: 'render',
              // 涟漪特效配置
              rippleEffect: {
                color: '#1229d5',
                scale: 4,
                // 波纹的绘制方式,可选'stroke'和'fill'
                brushType: 'stroke'
              },
              //圆心点
              hoverAnimation: true,
              itemStyle: {
                normal: {
                  color: '#0418a9',
                  shadowBlur: 80,
                  shadowColor: '#3a86ea',
                }
              },
              zlevel: 1
            }
          ], graphic: [
            {
              type: 'image', // 图形元素类型
              id: 'logo', // 更新或删除图形元素时指定更新哪个图形元素，如果不需要用可以忽略。
              right: 'center', // 根据父元素进行定位 （居中）
              bottom: '0%', // 根据父元素进行定位   （0%）, 如果bottom的值是 0，也可以删除该bottom属性值。
              z: 0,  // 层叠
              bounding: 'all', // 决定此图形元素在定位时，对自身的包围盒计算方式
              style: {
                image: img, // 这里一定要注意、注意，必须是https开头的图片路径地址
                width: 1030,
                height: 420
              }
            }
          ]
        }
        if (option2 && typeof option2 === 'object') {
          myChart.setOption(option2);
        }
        window.addEventListener("resize", () => {
          if(myChart!=null)myChart.resize();
        });//同比缩放
        //点击方法  根据巡检点，机器人id，任务id查询视频
        myChart.on("click", (params) => {
          this.loading5 = true;
          //根据坐标查询巡检点、机器人id、任务id
          this.areationresultList = null;
          if (typeof params.value != 'undefined') {
            let xypositon1 = params.value + '';
            let xypositonarr = xypositon1.split(',');
            if (xypositonarr.length > 2) {
              this.queryParams.xyposition = xypositonarr[0] + "," + xypositonarr[1] + "";
              aerationResultReport(this.queryParams).then(response => {
                if (typeof response.rows != 'undefined' && response.rows != null && response.rows != '') {
                  this.open5 = true;
                  this.title5 = "分析报告";
                  this.areationresultList = response.rows;
                  this.open5 = false;
                } else {
                  this.open5 = false;
                  this.$modal.msg('非巡检点！');
                }
                this.queryParams.xyposition="";
              });
            } else {
              this.$modal.msgError('巡检点坐标异常！！');
            }
          }
        });
      }, 1);
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.patrolpointList=[];
      this.reset();
      this.open = true;
      this.title = "新增任务";
      this.getrobotList();//机器人列表
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getPatrolTask(id).then(response => {
        //反显的时候用，手动调用 start
        this.getOptions(response.data.site_id);
        //end
        this.form = response.data;
        this.open = true;
        this.title = "修改任务";
      });
      //该机器人所有的巡检点
      getPatrolTaskPoints(id).then(response => {
        this.patrolpointList = response.list;
      });
    },
    /** 提交按钮 */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
        if (valid) {
           this.form.point_ids = this.point_ids;
           this.form.pond_nums = this.pond_nums;
           this.form.label_nums = this.label_nums;
           this.form.position_dists = this.position_dists;
           this.form.xypositions = this.xypositions;
           this.form.position_nums = this.position_nums;
           this.form.points_types = this.points_types;
           this.form.task_type=1;
          //分析内容
           for (let x = 0; x < this.point_ids.length; x++) {
             if(this.points_types[x] == ''|| this.points_types[x] == null){
               this.$modal.confirm1('请选(池子编号='+this.pond_nums[x]+"滤格,标签号="+this.label_nums[x]+'):对应巡检内容！');
               return false;
             }
           }
           //添加巡检点
           if(this.form.point_ids == undefined || this.form.point_ids == ""){
            this.$modal.confirm1('请在该任务下添加巡检点！');
            return false;
           }//池子号
           if(this.form.pond_nums == undefined || this.form.pond_nums == ""){
            this.$modal.confirm1('池子编号不能为空！');
            return false;
           }/*//分析内容
           if(this.form.points_types == undefined || this.form.points_types == ""|| this.form.points_types == ","){
            this.$modal.confirm1('分析内容不能为空！');
            return false;
           }*///标签编号
           if(this.form.label_nums == undefined || this.form.label_nums == ""){
            this.$modal.confirm1('标签编号不能为空！');
            return false;
           }//标签名称
           if(this.form.position_nums == undefined || this.form.position_nums == ""){
            this.$modal.confirm1('标签名称不能为空！');
            return false;
           }//距起点距离
           if(this.form.position_dists == undefined || this.form.position_dists == ""){
             this.$modal.confirm1('距起点距离不能为空！');
             return false;
           }
           if(this.form.xypositions == undefined || this.form.xypositions == ""){
            this.$modal.confirm1('标签编号不能为空！');
            return false;
           }
           if(this.form.execution_time == undefined || this.form.execution_time == ""){
             this.$modal.confirm1('执行时刻不能为空！');
             return false;
           }
       /*   //停留时间
          let residencetime = $("#residencetime").val();
          if(residencetime == undefined || residencetime == null || residencetime == "") {
            this.form.residencetime = undefined;
            this.$modal.confirm1('停留时间不能为空');
            return false;
          }
          if(residencetime < 6) {
            this.$modal.confirm1('停留时间至少设置6');
            return false;
          }*/
          //新增
          addPatrolTask(this.form).then(response => {
            this.$modal.msgSuccess("新增成功");
            this.open = false;
            this.getList();
          });
        }
      });
    },
    /**删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      const task_names =row.task_name || this.task_names
      this.$modal.confirm('是否确认删除任务名称为"' + task_names + '"的数据项？').then(function() {
        return delPatrolTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /**自动任务按钮操作 */
    handleAuto(row) {
      const ids = row.id || this.ids;
      const task_names =row.task_name || this.task_names
      this.$modal.confirm('设置自动任务 "' + task_names + '" ？').then(function() {
        return AutoPatrolTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("设置成功");
      }).catch(() => {});
    },
    /**取消自动任务按钮操作 */
    handleUAuto(row) {
      const ids = row.id || this.ids;
      const task_names =row.task_name || this.task_names
      this.$modal.confirm('取消自动任务 "' + task_names + '" ？').then(function() {
        return UAutoPatrolTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("取消成功");
      }).catch(() => {});
    },
    /**下发任务按钮操作 */
    handleRestore(row) {
      const ids = row.id || this.ids;
      const task_names =row.task_name || this.task_names
      this.$modal.confirm('是否确认下发 "' + task_names + '" 的任务项？').then(function() {
        return restoreTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("下发任务成功");
      }).catch(() => {});
    },
    /**撤销任务按钮操作 */
    handleCancel(row) {
      const ids = row.id || this.ids;
      const task_names =row.task_name || this.task_names
      this.$modal.confirm('是否撤销 "' + task_names + '" 的任务项？').then(function() {
        return cancelTask(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("撤销任务成功");
      }).catch(() => {});
      //历史报告列表
    },handleTaskReport(row){
      this.open2 = true;
      this.titlepoint2 = "历史报告列表";
      this.loading2 = true;
      this.queryParams1.task_type = 1;//普通巡检
      this.queryParams1.task_id = row.id;
      listAerationPort1(this.queryParams1).then(response => {
        this.partroltaskhis = response.rows;
        this.loading2 = false;
      });
    },
    /**点位详情按钮操作 */
    handleTaskPoint(row) {
      const id = row.id || this.ids
      getPatrolTaskPoint(id).then(response => {
        if(typeof response.rows !='undefined' && response.rows!=null && response.rows!=''){
          this.patroltaskpointList = response.rows;
        }else {
          this.patroltaskpointList =[];
        }
        this.open1 = true;
        this.titlepoint = "巡检点详细";
      });
    },//取消按钮
    cancel1() {
      this.open1 = false;
      this.reset();
    },
    cancel2() {
      this.open2 = false;
      this.reset();
    },
  }
};
</script>
<style rel="stylesheet/scss" lang="scss">
/**列表添加垂直隐藏滚动条**/
.tabled{
height: 550px;
overflow: hidden;
overflow-y: scroll;
}
.tabled::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
}
.el-dropdown-menu__item:not(.is-disabled):hover, .el-dropdown-menu__item:focus {
  background-color: #0b52bd;
}
/**列表添加垂直隐藏滚动条**/
.tabled1{
  height: 266px;
  overflow: hidden;
  overflow-y: scroll;
}
.tabled1::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

#app {
  width: 1120px;
  //min-height: 100vh;
  box-sizing: border-box;
  //padding: 50px;
  //background-color: aquamarine;
  .box {
    width: 100%;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 1px solid #2B5B9B;
    border-top: 1px solid #2B5B9B;
    .content1 {
      width: 50%;
      height: 35px;
      line-height: 35px;
      text-align: center;
      background-color: #07164B;
      border-right: 1px solid #2B5B9B;
      border-bottom: 1px solid #2B5B9B;
      border-top: 1px solid #2B5B9B;
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #D7D7D7;
    }
    .content2 {
      width: 50%;
      height: 35px;
      line-height: 35px;
      text-align: center;
      background: #0E2356;
      border-right: 1px solid #2B5B9B;
      border-bottom: 1px solid #2B5B9B;
      border-top: 1px solid #2B5B9B;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #D7D7D7;
      font-size: 12px;
    }
  }
}
</style>
